package com.scedu.luckeymoney;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RestController //相当于@ResponseBody ＋ @Controller合在一起的作用
public class HelloController {


//    @Value("${minMoney}")
//    private BigDecimal minMoney;
//
//    @Value("${descraption}")
//    private String descraption;
    @Autowired
    private LimitConfig limitConfig;
    //@PostMapping("/hello")
    //@RequestMapping(value="/hello")
    @GetMapping("/hello") //== @RequestMapping(value="/hello",method = RequestMethod.GET)
    //@RequestMapping(value="/hello",method = RequestMethod.GET)
    public String hello(){
        return "学法红包说明："+limitConfig.getDescraption();
    }
    @GetMapping("/say/{id}")
    public String say(@PathVariable(value = "id") Integer id){
        return "您输入的id是："+id;
    }

    @GetMapping("/say1")
    public String say1(@RequestParam(value = "id",required = false,defaultValue = "0") Integer id){
        return "您输入的id是："+id;
    }
}
